package com.qfedu.openplateform.manager.service.impl;

import com.qfedu.openplateform.manager.dao.CustomerMapper;
import com.qfedu.openplateform.manager.entity.Customer;
import com.qfedu.openplateform.manager.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CustomerServiceImpl implements CustomerService {
    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public List<Customer> SelectAllCustomer() {

        List<Customer> customers = customerMapper.SelectAllCustomer();

        return customers;

    }

    @Override
    public int updateCustomer(Customer customer) {

        int i = customerMapper.updateCustomer(customer);

        return i;
    }

    @Override
    public int deleteCustomer(Integer ids) {

        int i = customerMapper.deleteCustomer(ids);

        return i;
    }

    @Override
    public int addCustomer(Customer customer) {

        int i = customerMapper.addCustomer(customer);

        return i;
    }

    @Override
    public List<Customer> SelectCustomerByName(Integer state,String name) {

        List<Customer> customers = customerMapper.SelectCustomerByName(state,name);

        return customers;
    }
}
